package com.llc.station.kcp.ui.core.bean;

import javafx.scene.paint.Color;

import java.util.Arrays;
import java.util.List;

/**
 * 作者 朱小杰
 * 时间 2017/9/12
 * 说明 [说明此类的作用]
 */
public class MacCar {

    /**
     * 免密
     */
    public final static String TYPE_MIANMI = "MIANMI";
    /**
     * 专车用户
     */
    public final static String TYPE_SPC = "SPC";
    /**
     * 普通会员
     */
    public final static String TYPE_MEMBER = "MEMBER";
    /**
     * 车牌号
     */
    private String carNumber;

    /**
     * 加油升数
     */
    private double qty;

    /**
     * 加油金额，元
     */
    private double money;

    /**
     * 用户标签
     */
    private List<String> tags;


    public MacCar(String carNumber, double qty, double money, List<String> tags) {
        this.carNumber = carNumber;
        this.qty = qty;
        this.money = money;
        this.tags = tags;
    }

    public TagColor getUniqueTag(){
        if(tags.contains(TYPE_SPC)){
            return new TagColor("专",Color.GREEN);
        }else if(tags.contains(TYPE_MIANMI)){
            return new TagColor("免",Color.CHOCOLATE);
        }else if(tags.contains(TYPE_MEMBER)){
            return new TagColor("会",Color.rgb(21,89,158));
        }else{
            return new TagColor("无",Color.rgb(225,226,227));
        }
    }

    public static TagColor getUniqueTag(String tag){
        if(tag.equals(TYPE_SPC)){
            return new TagColor("专",Color.GREEN);
        }else if(tag.equals(TYPE_MIANMI)){
            return new TagColor("免",Color.CHOCOLATE);
        }else if(tag.equals(TYPE_MEMBER)){
            return new TagColor("会",Color.rgb(21,89,158));
        }else{
            return new TagColor("无",Color.rgb(225,226,227));
        }
    }




    public MacCar() {
    }

    public String getCarNumber() {
        return carNumber;
    }

    public void setCarNumber(String carNumber) {
        this.carNumber = carNumber;
    }

    public double getQty() {
        return qty;
    }

    public void setQty(double qty) {
        this.qty = qty;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public List<String> getTags() {
        return tags;
    }

    public void setTags(List<String> tags) {
        this.tags = tags;
    }

    @Override
    public String toString() {
        return "MacCar{" +
                "carNumber='" + carNumber + '\'' +
                ", qty=" + qty +
                ", money=" + money +
                ", tags=" + tags+
                '}';
    }


    public static class TagColor{
        private String tag;

        private Color color;

        public TagColor(String tag, Color color) {
            this.tag = tag;
            this.color = color;
        }

        public String getTag() {
            return tag;
        }

        public void setTag(String tag) {
            this.tag = tag;
        }

        public Color getColor() {
            return color;
        }

        public void setColor(Color color) {
            this.color = color;
        }

        @Override
        public String toString() {
            return "TagColor{" +
                    "tag='" + tag + '\'' +
                    ", color=" + color +
                    '}';
        }
    }
}
